import { BasicColumn } from '/@/components/Table';
import { FormSchema } from '/@/components/Table';
import { orderUpload } from '/@/api/citic/order';

export function getBasicColumns(): BasicColumn[] {
  return [
    {
      title: '订单文件名称',
      dataIndex: 'name',
      width: 160,
      align: 'left',
    },
    {
      title: '订单同步补推开始时间',
      dataIndex: 'startTime',
      width: 120,
      align: 'left',
    },
    {
      title: '订单申请补推数量',
      dataIndex: 'total',
      width: 100,
      align: 'left',
    },
    {
      title: '补推成功数量',
      dataIndex: 'success',
      width: 100,
      align: 'left',
    },
    {
      title: '同步状态',
      dataIndex: 'statusStr',
      width: 60,
      align: 'left',
    },
    {
      title: '同步完成时间',
      dataIndex: 'endTime',
      width: 120,
      align: 'left',
    },
  ];
}

export const downloadSchema: FormSchema[] = [
  {
    field: 'orderUpload',
    label: '提交补推订单号',
    component: 'Upload',
    colProps: { span: 8 },
    rules: [{ required: true, message: '请选择上传文件' }],
    componentProps: {
      api: orderUpload,
      maxSize: 20,
      accept: ['xlsx']
    },
  },
];

